package com.db.concurrency.vehicles;

/**
 * SynchronizedPoint
 * 
 * @author Anton Kotov
 */

public class SynchronizedPoint {
  private int x, y;

  private SynchronizedPoint(int[] a) {
    this(a[0], a[1]);
  }

  public SynchronizedPoint(SynchronizedPoint p) {
    this(p.get());
  }

  public SynchronizedPoint(int x, int y) {
    this.set(x, y);
  }

  public synchronized int[] get() {
    return new int[] { x, y };
  }

  public synchronized void set(int x, int y) {
    this.x = x;
    this.y = y;
  }
  
}
